from app.core.base_response import UnicornException
from app.core.db.database import db
from app.core.error.code_total import StatusCode
from app.core.sql_compilations import SQLCompilations
from app.utils.tools import Tools


async def create(model):
    _title = model.title
    _sub_title = model.sub_title
    _synopsis = model.synopsis
    _remark = model.remark
    _source_id = model.source_id
    _category_id = model.category_id
    _user_id = model.user_id

    id = Tools.uid()
    db.insert(SQLCompilations.Barrage.CREATE, id, _title, _sub_title, _synopsis, _remark, _source_id, _category_id,
              _user_id)
